import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { StartComponent } from './home/start/start.component';
import {JoinRollComponent} from "./home/join-roll/join-roll.component";
import {classInfoComponent} from "./home/class-info/class-info.component";
import {MyGradeComponent} from "./home/class-info/my-grade/my-grade.component";
import {classMembersComponent} from "./home/class-info/class-members/class-members.component";
import {classNoticesComponent} from "./home/class-info/class-notices/class-notices.component";

export const routes: Routes = [
  //首页
  {
    path: 'home', component: HomeComponent, data: { menu: 'home' },
    children: [
      { path: 'start', component: StartComponent, data: { menu: 'home', submenu: 'start' } },
      { path: '', redirectTo: 'start', pathMatch: 'full' },
      {
       path:'joinRoll',component:JoinRollComponent
      }
    ]
  },
  { path: '', redirectTo: 'home', pathMatch: 'full' },
  {
    path:'class',component:classInfoComponent,
    children:[
      {path:'grade',component:MyGradeComponent},
      {path:'',redirectTo: 'grade', pathMatch: 'full'},
      {path:'members',component:classMembersComponent},
      {path:'notices',component:classNoticesComponent}
    ]
  }
];
@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule],
  providers: [

  ]
})
export class AppRoutingModule { }
